package mybatisPlugin.controller;

import mybatisPlugin.dao.TeamDao;
import mybatisPlugin.entity.Team;
import mybatisPlugin.manager.UserManager;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author caihe
 * @date 2022/12/16 9:43
 */
@RestController
public class MybatisController {
    @Resource
    private UserManager userManager;
    @Resource
    private TeamDao teamDao;


    @GetMapping("/team")
    public Object getAllTeams() {
//        aopService.printTest();

        List<Team> allTeams = teamDao.getAllTeams();
        return allTeams;

    }

    @GetMapping("/test")
    public Object test() {
        return userManager.userList();
    }

    @GetMapping("/update")
    public Object update() {

        return userManager.update();
    }

    @GetMapping("/list")
    public Object testList() {
        return userManager.userList1();
    }

    @GetMapping("/phone")
    public Object phone() {
        return userManager.getUserPhone();
    }
}
